package com.ws.wsdemo2.config;

import com.ws.wsdemo2.server.PushQuoteThread;
import com.ws.wsdemo2.server.SubThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 系统初始化类
 * 
 * @author hbm
 *
 */
@Component
public class SystemInitBean implements InitializingBean {

	static Logger logger = LoggerFactory.getLogger(SystemInitBean.class);
	@Autowired
	private PushQuoteThread pushquote;
	@Autowired
	private SubThread subThread;
	private static boolean isStart = false;
	public void afterPropertiesSet() throws Exception {

		if(!isStart){
			isStart = true;
			logger.info("-------------开始启动初始服务--------------");
			/*new Thread(pushquote).start();*/
			new Thread(subThread).start();
			logger.info("---------启动初始服务完毕-------------------");
		}
	}
}
